<template>
  <div id="app">
    <nav-bar />

    <transition name="el-fade-in" mode="out-in">
      <router-view/>
    </transition>
    <el-backtop :bottom="50" ref="backtop">
        <div
          style="{
            height: 100%;
            width: 100%;
            background-color: #f2f5f6;
            box-shadow: 0 0 6px rgba(0,0,0, .12);
            text-align: center;
            line-height: 40px;
            color: #1989fa;
            z-index: 999;
            border-radius: 50%;
          }"
        >
          <i class="el-icon-top"></i>
        </div>
    </el-backtop>
    
  </div>
</template>
<script>
import NavBar from './components/NavBar'
export default {
  components: {
    NavBar
  },
  watch: {
    // 解决使用element-ui的navmenu时切换路由并不在顶部
    '$route.path'() {
      // console.log( this.$refs.backtop)
      this.$refs.backtop.handleClick()
    }
  },
}
</script>
<style lang="scss">
#app {
}
</style>
